package com.mini.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Time;
import java.util.Date;

/**
 * 项目名称：traditional-business
 * 类 名 称：BusinessRequirementPlanBaseBean
 * 类 描 述：TODO
 * 创建时间：2020/12/15 下午12:01
 * 创 建 人：zhanghuiying
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EntityListeners(AuditingEntityListener.class)
@Entity(name = "business_requirement_plan_base")
public class BusinessRequirementPlanBaseBean implements Serializable {
    @Id
    private Long id;
    private Long quantumArmyGroupId;
    private Integer cardCount;
    private Date endTime;
    private Integer receivingResidue;
    private Integer pattern;
    @CreatedDate
    private Date createTime;
    @LastModifiedDate
    private Date updateTime;
    private Long createUserId;
    private Long updateUserId;
    private Integer baseDelete;
    private Date planDate;

    public String makeReceivingResidue(){
        if (this.getReceivingResidue()==1){
            return "是";
        }
        if (this.getReceivingResidue()==0){
            return "否";
        }
        return "";
    }
    public String makePattern(){
        if (this.getPattern()==0){
            return "A+B模式";
        }
        if (this.getPattern()==1){
            return "A模式";
        }
        if (this.getPattern()==2){
            return "B模式";
        }

        return "";
    }
}
